package com.xxx.mall.api;

import com.xxx.mall.context.AuthUserContext;
import com.xxx.mall.response.R;
import com.xxx.mall.service.SysUserService;
import com.xxx.mall.vo.SysUserInfoVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 平台用户 前端控制器
 * </p>
 *
 * @author 邢晨旭
 * @since 2023-11-19
 */
@RestController
@RequestMapping("/sys_user")
public class SysUserApi {

    @Resource
    SysUserService sysUserService;

    @GetMapping("/info")
    public R<SysUserInfoVO> info() {
        return R.ok(sysUserService.getUserInfoByUserId(AuthUserContext.get().getUserId()));
    }

}
